/*
 * @Description: 身份认证
 * @Author: iamsmiling
 * @Date: 2021-05-28 20:57:10
 * @LastEditTime: 2021-06-15 10:35:14
 */
import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/domain/local/auth/auth_entity.dart';
import 'package:credit_business_circle/pages/mine/children/auth/auth_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class AuthPage extends GetView<AuthController> {
  const AuthPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("身份认证"),
      ),
      body: Container(
        margin: EdgeInsets.only(
            left: R.dimen.dp18, right: R.dimen.dp18, top: R.dimen.dp10),
        child: ListView(
          children: [
            for (AuthEntity item in controller.list)
              GestureDetector(
                onTap: item.onTap,
                child: Container(
                  margin: EdgeInsets.only(top: R.dimen.dp20),
                  decoration: BoxDecoration(
                      color: R.color.ffffffff,
                      borderRadius: BorderRadius.circular(R.dimen.sp5)),
                  padding: EdgeInsets.symmetric(
                      horizontal: R.dimen.dp20, vertical: R.dimen.dp34),
                  child: Row(
                    children: [
                      Image.asset(item.icon),
                      Container(
                        margin: EdgeInsets.only(left: R.dimen.dp12),
                        child: Text(
                          item.label,
                          style: TextStyle(
                              fontSize: R.dimen.sp16,
                              color: R.color.ff222222,
                              fontWeight: FontWeight.w600),
                        ),
                      ),
                      Spacer(),
                      Container(
                        padding: EdgeInsets.symmetric(
                            vertical: R.dimen.dp6, horizontal: R.dimen.dp20),
                        decoration: item.finished
                            ? BoxDecoration(
                                gradient: LinearGradient(colors: [
                                  R.color.ff2ecf9f,
                                  R.color.ff1bbf8e
                                ]),
                                borderRadius:
                                    BorderRadius.circular(R.dimen.sp16))
                            : BoxDecoration(
                                color: R.color.ffeeeeee,
                                borderRadius:
                                    BorderRadius.circular(R.dimen.sp16)),
                        child: Text(
                          item.status,
                          style: TextStyle(
                              fontSize: R.dimen.sp15,
                              color: item.finished
                                  ? R.color.ffffffff
                                  : R.color.ff555555),
                        ),
                      )
                    ],
                  ),
                ),
              ),
            Container(
              color: R.color.fff5f5f5,
              padding: EdgeInsets.only(top: R.dimen.dp15, bottom: R.dimen.dp15),
              alignment: Alignment.center,
              child: Text(
                "认证中遇到问题",
                style:
                    TextStyle(fontSize: R.dimen.sp14, color: R.color.ff0587c3),
              ),
            ),
          ],
        ),
      ),
      bottomNavigationBar: Container(
        color: R.color.ffffffff,
        alignment: Alignment.center,
        padding: EdgeInsets.only(bottom: Get.mediaQuery.padding.bottom),
        height: kBottomNavigationBarHeight + Get.mediaQuery.padding.bottom,
        child: Text(
          "提交反馈",
          style: TextStyle(color: R.color.ff333333, fontSize: R.dimen.sp15),
        ),
      ),
    );
  }
}
